package han.service;

import han.dao.DetailMapper;
import han.pojo.Details;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @authou HanDianWei
 * @create 2020-10-23 14:11
 */
@Service
public class DetailServiceImpl implements DetailService {
//    service调dao层  组合dao
    private DetailMapper detailMapper;
    public void setDetailMapper(DetailMapper detailMapper) {
        this.detailMapper = detailMapper;
    }

    public int addDetail(Details details) {
        return detailMapper.addDetail(details);
    }

    public int updDetail(Details details) {
        System.out.println("DetailServiceImpl:updDetail==>"+details);
        return detailMapper.updDetail(details);
    }

    public int delDetailById(int id) {
        return detailMapper.delDetailById(id);
    }

    public List<Details> getDetailByName(String name) {
        return detailMapper.getDetailByName(name);
    }

    public Details getDetailById(int id) {
        return detailMapper.getDetailById(id);
    }

    public List<Details> getDetailByClassId(int cid) {
        return detailMapper.getDetailByClassId(cid);
    }

    public List<Details> getAllDetail() {
        return detailMapper.getAllDetail();
    }
}
